#ifndef __USER_ADC_H
#define __USER_ADC_H

#ifdef __cplusplus
extern "C" {
#endif

#include "at32f413.h"
#include "at32f413_adc.h"

/* ADC通道定义 */
#define ADC_CHANNEL_0_PIN                GPIO_PINS_0
#define ADC_CHANNEL_0_PORT               GPIOA
#define ADC_CHANNEL_0_ADC_CHANNEL        ADC_CHANNEL_0

#define ADC_CHANNEL_1_PIN                GPIO_PINS_1
#define ADC_CHANNEL_1_PORT               GPIOA
#define ADC_CHANNEL_1_ADC_CHANNEL        ADC_CHANNEL_1

#define ADC_CHANNEL_2_PIN                GPIO_PINS_2
#define ADC_CHANNEL_2_PORT               GPIOA
#define ADC_CHANNEL_2_ADC_CHANNEL        ADC_CHANNEL_2

/* 函数声明 */
void adc_init(void);
uint16_t adc_get_value(uint8_t channel);

#ifdef __cplusplus
}
#endif

#endif /* __USER_ADC_H */ 